package com.holly.unit.dict.modular.controller;


import com.holly.unit.core.pojo.request.BaseRequest;
import com.holly.unit.core.pojo.response.ResponseData;
import com.holly.unit.core.pojo.response.SuccessResponseData;
import com.holly.unit.dict.modular.entity.HollyFormType;
import com.holly.unit.dict.modular.entity.HollyFormTypeRequest;
import com.holly.unit.dict.modular.service.IHollyFormTypeService;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.GetResource;
import com.holly.unit.scanner.api.annotation.PostResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
 /**
 * @Description: 表单分类
 * @Author: holly
 * @Date:   2022-02-23 03:57:21
 * @Version: V1.0
 */
@RestController
@ApiResource(name = "表单分类")
@Api(tags = "表单分类")
public class HollyFormTypeController {

	@Resource
	private IHollyFormTypeService hollyFormTypeService;

	/**
     * 添加
     *
     * @param hollyFormTypeRequest
     * @return
     */
    @ApiOperation(value = "表单分类_增加" ,notes = "表单分类_增加")
    @PostResource(name = "表单分类_增加", path = "/hollyFormType/add", requiredPermission = false , requiredLogin = false)
    public ResponseData add(@RequestBody @Validated(BaseRequest.add.class) HollyFormTypeRequest hollyFormTypeRequest) {
    	hollyFormTypeService.add(hollyFormTypeRequest);
    	return new SuccessResponseData();
    }
    /**
     * 编辑
     * @param hollyFormTypeRequest
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类_编辑" ,notes = "表单分类_编辑")
    @PostResource(name = "表单分类_编辑", path = "/hollyFormType/edit", requiredPermission = false , requiredLogin = false)
    public ResponseData edit(@RequestBody @Validated(HollyFormTypeRequest.edit.class) HollyFormTypeRequest hollyFormTypeRequest) {
        hollyFormTypeService.edit(hollyFormTypeRequest);
        return new SuccessResponseData();
    }
	
	/**
     * 删除
     *
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类_删除" ,notes = "表单分类_删除")
    @PostResource(name = "表单分类_删除", path = "/hollyFormType/delete", requiredPermission = false , requiredLogin = false)
    public ResponseData delete(@RequestBody @Validated(HollyFormTypeRequest.delete.class) HollyFormTypeRequest hollyFormTypeRequest) {
        hollyFormTypeService.del(hollyFormTypeRequest);
        return new SuccessResponseData();
    }
	/**
     * 详情
     *
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类_详情" ,notes = "表单分类_详情")
    @PostResource(name = "表单分类_详情", path = "/hollyFormType/detail", requiredPermission = false , requiredLogin = false)
    public ResponseData detail(@RequestBody @Validated(HollyFormTypeRequest.detail.class) HollyFormTypeRequest hollyFormTypeRequest) {
       HollyFormType hollyFormType = hollyFormTypeService.detail(hollyFormTypeRequest);
        return new SuccessResponseData(hollyFormType);
    }
	
	/**
     * 导出
     *
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类_导出" ,notes = "表单分类_导出")
    @GetResource(name = "表单分类_导出", path = "/hollyFormType/export", requiredPermission = false , requiredLogin = false)
    public void export(HttpServletResponse response) {
        hollyFormTypeService.export(response);
    }
	
	/**
     * 分页列表查询
     *
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类分页查询" ,notes = "表单分类分页查询")
    @GetResource(name = "表单分类分页查询", path = "/hollyFormType/page", requiredPermission = false , requiredLogin = false)
    public ResponseData page(HollyFormTypeRequest hollyFormTypeRequest) {
        return new SuccessResponseData(hollyFormTypeService.findPage(hollyFormTypeRequest));
    }

	/**
     * 列表查询
     *
     * @author holly
     * @date 2022-02-23 03:57:21
     */
    @ApiOperation(value = "表单分类列表查询" ,notes = "表单分类列表查询")
    @GetResource(name = "表单分类列表查询", path = "/hollyFormType/list", requiredPermission = false , requiredLogin = false)
    public ResponseData list(HollyFormTypeRequest hollyFormTypeRequest) {
        return new SuccessResponseData(hollyFormTypeService.findList(hollyFormTypeRequest));
    }

}
